
import parole
from parole.colornames import colors
from parole.display import interpolateRGB
import pygame, random

import sim, main, sim_items
from util import *

class Potion(sim_items.Potion):
    def __init__(self):
        sim_items.Potion.__init__(self, "lycanthropy", "!",
                ('have', 'more', 'go', 'see'),
                idDescription="This fell potion, brewed at the apex "\
                    "of a full moon, briefly induces a terrible and "\
                    "unholy transformation in anyone reckless enough "\
                    "to quaff it.")

    def quaff(self, quaffer):
        self.amount = random.randint(9,11)
        self.duration = 30000

        main.schedule(sim.Event('statusNote+', main.schedule.time, (quaffer,
            'rawr!'), dests=[quaffer]))
        main.schedule(sim.Event('statusNote-', main.schedule.time +\
            self.duration, (quaffer, 'rawr!'), dests=[quaffer]))

        main.schedule(sim.Event('increase stat', main.schedule.time, (quaffer,
            'strengthMod', self.amount), dests=[quaffer]))
        main.schedule(sim.Event('decrease stat', main.schedule.time +\
            self.duration, (quaffer, 'strengthMod', self.amount), dests=[quaffer]))
        quaffer.identify(self)

        main.schedule(sim.Event('increase stat', main.schedule.time, (quaffer,
            'speedMod', self.amount), dests=[quaffer]))
        main.schedule(sim.Event('decrease stat', main.schedule.time +\
            self.duration, (quaffer, 'speedMod', self.amount), dests=[quaffer]))
        quaffer.identify(self)

        main.schedule(sim.Event('increase stat', main.schedule.time, (quaffer,
            'perceptionMod', self.amount), dests=[quaffer]))
        main.schedule(sim.Event('decrease stat', main.schedule.time +\
            self.duration, (quaffer, 'perceptionMod', self.amount), dests=[quaffer]))
        quaffer.identify(self)

#========================================
thingClass = Potion



